version: '3.8'
services:
  api:
    build: .
    restart: always
    pull_policy: build
    depends_on:
      - db
    env_file:
      - .env
    ports:
      - '8080:8080'

  db:
    image: postgres:14.1-alpine
    restart: always
    env_file:
      - .env
    ports:
      - '5433:5432'
    volumes:
      - db:/var/lib/postgresql/data

volumes:
  db:
    driver: local